#ifndef GOBANG_H
#define GOBANG_H

#include <vector>
#include <tuple>

class Gobang
{
public:
    explicit Gobang(unsigned int size);

    int place(uint8_t r, uint8_t c);
    int unplace();
    int get_status(uint8_t r, uint8_t c);
    int get_winner();

private:
    void check_win();
    bool valid(int r, int c);
    bool valid_s(int r, int c, int s);

    std::vector<std::tuple<uint8_t, uint8_t, int>> steps;
    std::vector<std::vector<int>> board;

    unsigned int size;
    int current_player;
    int winner;
};

#endif // GOBANG_H
